/**
 * 离异或已故配偶
 */
package com.findu.model;

import java.util.ArrayList;

/**
 *
 * @author 夏启根
 */
public class FUMateTree extends FUFamilyMember {

    public FUFamilyMember mate = null;
    public ArrayList<FUFamilyTree> childrens = null;    //  亲子
    public ArrayList<FUFamilyTree> stepchilds = null;   //  继子

    public FUMateTree(FUFamilyMember m) {
        super(m);
    }

    public FUFamilyTree findFUFamilyTreeByMember(String id) {
        FUFamilyTree node = null;
        if (this.childrens != null) {
            for (FUFamilyTree sub : this.childrens) {
                node = sub.findFUFamilyTreeByMember(id);
                if (node != null) {
                    return node;
                }
            }
        }
        if (this.stepchilds != null) {
            for (FUFamilyTree sub : this.stepchilds) {
                node = sub.findFUFamilyTreeByMember(id);
                if (node != null) {
                    return node;
                }
            }
        }
        return node;
    }

}
